﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JCSoft.Collect.Data;

namespace JCSoft.Collect.Bussness
{
    public class DataManagerBase : ManagerBase
    {
        private IRepositoryFactory m_repositoryFactory = null;

        protected DataManagerBase(MiddleTier middleTier)
            : this(middleTier, new RepositoryFactory())
        { }

        protected DataManagerBase(MiddleTier middleTier, IRepositoryFactory repositoryFactory)
            : base(middleTier)
        {
            this.m_repositoryFactory = repositoryFactory;
        }

        protected TRepository GetRepository<TRepository>()
        {
            return this.m_repositoryFactory.Create<TRepository>();
        }
    }
}
